/**
 * Copyright (C), 2012-2018, 联奕科技有限公司
 * FileName: ImageCode
 * Author:   石贵武
 * Date:     2018\3\9 0009 9:43
 * Description: 生成图片认证码
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.zhoudongxiu.security.core.vaildators.code;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.awt.image.BufferedImage;
import java.time.LocalDateTime;

/**
 * 〈一句话功能简述〉<br>
 * 〈生成短信认证码〉
 *
 * @author 石贵武
 * @create 2018\3\9 0009
 * @since 1.0.0
 */
@Data
@AllArgsConstructor
public class ValidateCode {

    private String code;

    private LocalDateTime expireTime;

    public ValidateCode( String code, int expireInt) {
        this.code = code;
        this.expireTime = LocalDateTime.now().plusSeconds(expireInt);

    }

    public boolean isExpried() {
        return LocalDateTime.now().isAfter(expireTime);
    }

}